<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html class="win-frame">
<head>
<title>${name_china}管理-编辑${name_china}</title>
<%@include file="/common/headmy.jsp" %>

<!-- 上传下载插件 -->
 <link href="<%=request.getContextPath()%>/static/plugin/uploadify/style/uploadify.css" rel="stylesheet">
 <script src="<%=request.getContextPath()%>/static/plugin/uploadify/js/jquery.uploadify.js"></script>

<!-- 时间日期插件 -->
<link href="<%=request.getContextPath()%>/static/plugin/My97DatePicker/skin/default/datepicker.css" rel="stylesheet" >
<script src="<%=request.getContextPath()%>/static/plugin/My97DatePicker/WdatePicker.js"></script>

<!--富文本插件 -->
<script src="<%=request.getContextPath()%>/static/plugin/ckeditor/ckeditor.js"></script>


</head>
<body class="iframe-page">
<div class="page-title-wrapper">
    <div class="page-title">
        <div class="page-title-text">
            <span>${name_china}管理</span>
            <span class="split"></span>
            <span>编辑${name_china}</span>
        </div>
        <a id="goBack" class="btn-return distance-left" href="javascript:;"><i class="icon icon-arrow-left"></i>返回上级</a>
    </div>
    <div class="page-title-border"></div>
</div>

<form id="form" method="post">
        <div class="form-wrapper">
	        <div class="h4 distance-double">
            <span class="h4-title"><i class="icon icon-setting"></i>问题信息</span>
            <span class="h4-border"></span>
        </div>
      
        <input type="hidden" id="id" name="id"> 
     
	     <div class="form-cont">
	        <p class="form-cont-title"><span class="field-required">*</span>用户账号</p>
	        <input type="text" id="account" name="account" class="summer-input summer-validatebox"  data-validatebox="validType:['required','mobile']"/> 
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title"><span class="field-required">*</span>订单号</p>
	        <input type="text" id="orderNum" name="orderNum" class="summer-input summer-validatebox"  data-validatebox="validType:['required','maxLength[32]']"/>  
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title"><span class="field-required">*</span>订单金额</p>
	        <input type="text" id="totalPrice" name="totalPrice" class="summer-input summer-validatebox"  data-validatebox="validType:['required','maxLength[32]']"/>  
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title"><span class="field-required">*</span>订单类型</p>
	        <input type="text" id="orderType" name="orderType" class="summer-input summer-validatebox distance-right" data-validatebox="tipPosition:'bottom',validType:['required']"/>
	     </div>
	     
	     <div class="form-cont">
	        <p class="form-cont-title"><span class="field-required">*</span>订单状态</p>
	        <input type="text" id="status" name="status" class="summer-input summer-validatebox distance-right" data-validatebox="tipPosition:'bottom',validType:['required']"/>
	     </div>
    <div class="form-btn-wrapper" id="funcbar">
    	<a href="javascript:;" class="btn btn-ok btn-normal  wave distance-right" data-id="8e632debb5df40f4ba48e2b238d0d85f" data-url="/mem/order/edit" data-mark="create" data-permit="order:edit">保存</a>
        <a class="btn btn-normal" id="backBtn">关闭</a>
    </div>
  </div>
</form>
<script>
    
  var   editData,
        permission = CommonUtil.getPermission('${name_english}');
    
    $(function () {
    	editData = ${editData};

    	
    	//初始化下拉选项
      	 $('#orderType').combobox({
      		async:false,
  		    defalutValue: editData.orderType,
              valueField : 'code',
              textField : 'name',
              url : COMMON_URL.getCode + '?type=T_WEB_ORDER_TYPE_LIST'
          });
      	 $('#status').combobox({
      		async:false,
  		    defalutValue: editData.status,
              valueField : 'code',
              textField : 'name',
              url : COMMON_URL.getCode + '?type=T_WEB_MEMBER_ORDER_STATUS'
          });

    	createConfig();// 初始化插件
	   	
        $('#form').form({
        	onLoadSuccess:function(data){
           }
        }).form('loadDataEdit', {
            data: editData
        }); 
    	

    	
    	//保存按钮
    	$('#funcbar').on('click', 'a[data-permit="${name_english}:edit"]',  submit);
    	
    	//返回按钮
    	$('#backBtn, #goBack').on('click',backMain);
    });
    
    
    

    
    //上传初始化方法
    function createConfig(){
    	initMyUploadConfig("fileId","imageId","hiddenfile","videoId","hiddenvideo","T_MODEL_TEMPLET","${pageContext.session.id}");
    }
    
    //上传初始化方法
    function initMyUploadConfig(fileId,imageId,hiddenfile,videoId,hiddenvideo,tableName,sessionId){
        initMutiFile(fileId,hiddenfile,tableName,sessionId);
    }
    
        //初始化图片和视频添加事件(记得动态添加表名)
        function initMutiFile(fileId,hiddenfile,tableName,sessionId){
     }
        
      
        

        //表单提交
        function submit() {
             $("#form").form({
            	 buttons : ['#saveBtn'],
                 ajax: {
                     url: CONST_URL.EDIT
                 },
                 onSubmitSuccess: function (data) {
                	 $.stip({
       	                type:'ok',//显示类型 有info、 ok、 danger
       	                text: '保存成功！',
       	                onBeforeHide: function () {
       	                	backMain();
       	                }
                	 });
                  }
             }).form("submit");
        } 

        	 
    
    //返回主页面
    function backMain() {
    	window.location.href = CONST_URL.INIT_MAIN;
    }
    
    //请求url
    var CONST_URL = {
        	INIT_MAIN: basePath + "${common_url}init",
           	EDIT: basePath + "${common_url}edit",
           	BASEIMAGE: basePath + "/static/images/addimage.png"
    };
    
</script>
</body>
</html>